import React from 'react';
import { createAc1, createAc2, createAc3 } from './action'

class App extends React.Component {
  // 下面可以去掉,因为state已经有store管理
  // constructor(props) {
  //   super(props)
  //   this.state = {}
  // }
  render() {
    const { store } = this.props
    console.log(store);
    const num = store.getState()
    return (
      <div>
        <p>{num}</p>
        <button onClick={() => {
          store.dispatch(createAc1())
        }}>+1</button>
        <button onClick={() => {
          store.dispatch(createAc2())
        }}>-1</button>
        <button onClick={() => {
          store.dispatch(createAc3())
        }}>异步+1</button>
      </div>
    )
  }
}
export default App;
